| Sendmail Configuration |
|
Sendmail is the default Mail Transfer Agent (MTA) in FreeBSD. sendmail's job is to accept
mail from Mail User Agents (MUA) and deliver it to the appropriate mailer as defined by its
configuration file. sendmail can also accept network connections and deliver mail to local
mailboxes or deliver it to another program.
sendmail uses the following configuration files: Filename /etc/mail/access - sendmail access database file /etc/mail/aliases - Mailbox aliases /etc/mail/local-host-names - Lists of hosts sendmail accepts mail for /etc/mail/mailer.conf - Mailer program configuration /etc/mail/mailertable - Mailer delivery table /etc/mail/sendmail.cf - sendmail master configuration file /etc/mail/virtusertable - Virtual users and domain tables /etc/mail/access The access database defines what host(s) or IP addresses have access to the local mail server and what kind of access they have. Hosts can be listed as OK, REJECT, RELAY or simply passed to sendmail's error handling routine with a given mailer error. Hosts that are listed as OK, which is the default, are allowed to send mail to this host as long as the mail's final destination is the local machine. Hosts that are listed as REJECT are rejected for all mail connections. Hosts that have the RELAY option for their hostname are allowed to send mail for any destination through this mail server. /etc/mail/aliases The aliases database contains a list of virtual mailboxes that are expanded to other user(s), files, programs or other aliases. The file format is simple; the mailbox name on the left side of the colon is expanded to the target(s) on the right. The first example simply expands the mailbox root to the mailbox localuser, which is then looked up again in the aliases database. If no match is found, then the message is delivered to the local user localuser. The next example shows a mail list. Mail to the mailbox ftp-bugs is expanded to the three local mailboxes joe, eric, and paul. Note that a remote mailbox could be specified as user@example.com. The next example shows writing mail to a file, in this case /dev/null. The last example shows sending mail to a program, in this case the mail message is written to the standard input of /usr/local/bin/procmail through a Unix pipe. /etc/mail/local-host-names This is a list of hostnames sendmail(8) is to accept as the local host name. Place any domains or hosts that sendmail is to be receiving mail for. For example, if this mail server was to accept mail for the domain example.com and the host mail.example.com, its local-host-names might look something like this: example.com mail.example.com When this file is updated, sendmail(8) needs to be restarted to read the changes. /etc/mail/sendmail.cf Sendmail's master configuration file, sendmail.cf controls the overall behavior of sendmail, including everything from rewriting e-mail addresses to printing rejection messages to remote mail servers. Naturally, with such a diverse role, this configuration file is quite complex and its details are a bit out of the scope of this section. Fortunately, this file rarely needs to be changed for standard mail servers. The master sendmail configuration file can be built from m4(1) macros that define the features and behavior of sendmail. Please see /usr/src/contrib/sendmail/cf/README for some of the details. When changes to this file are made, sendmail needs to be restarted for the changes to take effect. /etc/mail/virtusertable The virtusertable maps mail addresses for virtual domains and mailboxes to real mailboxes. These mailboxes can be local, remote, aliases defined in /etc/mail/aliases or files. |
| Building a sendmail.cf file |
|
To build a sendmail.cf, you first need a sendmail.mc file. This is the file that m4 will use
as its input. You should start by copying this sample file into the cf/cf directory within
the sendmail distribution. We will assume that this file is called cf/cf/sendmail.mc, although
you might want to give it a more descriptive name if you decide to customize it later.
In the cf/ostype directory, you will find m4 files for a variety of operating systems. Identify the file that corresponds to your system (e.g. cf/ostype/irix5.m4 for IRIX 5.x, or cf/ostype/solaris2.m4 f or Solaris 2.x). Some of the files include comments that may help you determine if they're appropriate for your system or not. If there is no file corresponding to your operating system, you'll have to create your own. See the OSTYPE section in cf/README for information about what this file should contain. It may be easiest to copy one of the existing m4 files and change any values that are not appropriate for your system. In the sample cf/cf/sendmail.mc file, you'll need to replace the word "unknown" in the second line with the name of your operating system. This is the name of the file you identified in the cf/ostype directory, but without the leading directory names and the trailing .m4 suffix. So if your ostype file was cf/ostype/irix5.m4, for example, then the second line of your sendmail.mc file should be: OSTYPE(irix5) You are now ready to create the sendmail.cf file by running m4: cd cf/cf m4 sendmail.mc > sendmail.cf (as root) cp sendmail.cf /etc/sendmail.cf You are now ready to start running your new version of sendmail. The sendmail.cf file that you've just installed will allow sendmail to deliver messages locally and transmit mail directly to other sites on the Internet. If you want to use any of sendmail's more advanced features (such as host masquerading, or acting as a mail exchanger for other hosts), the sources listed in the bibliography will tell you how to add these features to your sendmail.mc file (after which you will need to rebuild sendmail.cf, copy the new file to /etc/sendmail.cf, and restart sendmail). |
| My another interests and hobbies |
|
My sports hobbies are: martial arts of China. The martial arts of the
ancient monks. My favourite computer games: Quake and WarCraft My favourite singer is Elton John and I like his songs and arts. Also I like the Queen band and all his old albums. Another side of my life: i am a 35 year old gay man and I have been in a relationship with Mike since May 1st 1995. Here you can find the some links concerning of my interests: |